using System.Collections.Generic;
using FluentNHibernate.Conventions;
using FluentNHibernate.Mapping;
using Webshop20.Infrastructure.Persistence.NH.AutoMappings.Conventions.Common;

namespace Webshop20.Infrastructure.Persistence.NH.AutoMappings.Conventions.Common
{
    public class IdConvention : IIdConvention 
    {
        public bool Accept(IIdentityPart target)
        {
            if(ClassIs.Excluded(target.EntityType.Name))
                return false;
            return true;
        }

        public void Apply(IIdentityPart target)
        {
            target.GeneratedBy.Increment();
        }


    }
}